package com.jbm.jbmsupplier.util;

import org.apache.mina.core.service.IoHandlerAdapter;
import org.apache.mina.core.session.IoSession;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Created by root on 16-1-19.
 */

public class MinaClientHandler extends IoHandlerAdapter {
    protected static Logger logger = LoggerFactory.getLogger(MinaClientHandler.class);

    public MinaClientHandler ( )
    {
    }

    public void exceptionCaught(IoSession session, Throwable cause) throws Exception {
        logger.error("client端发送异常...", cause);
    }

    public void messageReceived(IoSession session, Object message) throws Exception {
    }

    public void sessionCreated(IoSession session) throws Exception {
        logger.info("客户端与服务端创建连接...");
        session.setAttribute("PROTOC_TYPE", "0");
    }
}
